/*
 * SearchTableModel.java
 *
 * Created on 24 July 2003, 08:12
 * Copyright (C) 2003, Velocityme Partnership
 */

package com.velocityme.client.gui;

import com.velocityme.utility.NodeSearchResult;

/**
 *
 * @author  Robert Crida Work
 */
public class SearchTableModel extends VectorTableModel {
    
    /** Creates a new instance of SearchTableModel */
    public SearchTableModel() {
        super(new String[] {"ID", "Priority %", "Name", "Task Type", "Status", "Responsible"});
    }
    
    /** Add a new row to the table.
     */
    public void addRow(NodeSearchResult p_result) {
        m_dataRows.addElement(new Object[]{ p_result.m_ID, p_result.m_priority, p_result.m_name, p_result.m_taskType, p_result.m_status, p_result.m_responsible, p_result });
        fireTableRowsInserted(m_dataRows.size() - 1, m_dataRows.size());
    }
    
    public Integer getID(int p_row) {
        return (Integer)((Object[])m_dataRows.get(p_row))[0];
    }
    
}
